home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / mui / bcc.lha / BCC / Examples / BCCopts / MUI_Main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-19  |  905 b   |  47 lines

  1. #include <proto/exec.h>
  2. #include <proto/dos.h>
  3. #include <proto/intuition.h>
  4. #include <proto/graphics.h>
  5. #include <proto/lowlevel.h>
  6.  
  7. #include "initcl.h"
  8. #include "App.h"
  9.  
  10. #include <libraries/bcc.h>
  11.  
  12. struct Library *MUIMasterBase;
  13. Object *app;
  14.  
  15. extern ULONG __stack = 10000;
  16. extern ULONG __OSlibversion = 36;
  17.  
  18. main()
  19. {
  20.     int running = TRUE, ret = RETURN_OK;
  21.     ULONG signals;
  22.     
  23.     if( MUIMasterBase = OpenLibrary( MUIMASTER_NAME, MUIMASTER_VMIN ) ) {
  24.         if( _initclasses() ) {
  25.             if( app = AppObject, End ) {
  26.  
  27.                 while (running)
  28.                 {
  29.                     switch( DoMethod( app, MUIM_Application_Input, &signals ) ) {
  30.                         case MUIV_Application_ReturnID_Quit:
  31.                             running = FALSE;
  32.                             break;
  33.                     }
  34.                 
  35.                     if( running && signals ) Wait( signals );
  36.  
  37.                 }
  38.                 MUI_DisposeObject( app );
  39.             }
  40.             _freeclasses();
  41.         } else ret = RETURN_ERROR;
  42.         CloseLibrary( MUIMasterBase );
  43.     } else ret = RETURN_ERROR;
  44.     
  45.     return ret;
  46. }
  47.